#include<iostream>
#include<algorithm>

using namespace std;

const int mod=1e9+7;

int n;
 

int main()
{
	cin>>n;
	
	long long sum=1,a=1,b=3;
	for(int i=1;i<=n;i++){
		if(i==1)  b=0;
		if(i==2)  b=1;
		if(i==3)  b=3;
		else{
			int c=a+b;
			a=b,b=c;
		}
		sum=sum*i%mod;
	}
	
	cout<<sum-b<<endl;
	
	return 0;
}
